home *** CD-ROM | disk | FTP | other *** search
/ Computer Life 1997 February / Computer Life February 1997.iso / TELME / COMMS / ISDNUSER.SRP < prev    next >
Encoding:
Text File  |  1996-06-05  |  4.9 KB  |  171 lines

  1. rem Copyright (c) PhoneLink plc 
  2. rem User Defined ISDN Skeleton Script (10/8/95)
  3.  
  4. rem ******************************************************************
  5. rem ***** This script is only an outline and will not work as it
  6. rem ***** stands.  It requires additional information to be inserted
  7. rem ***** where you see (***   ***).  A carriage return is denoted by
  8. rem ***** char(13), and is sometimes required at the end of a command
  9. rem ***** string.
  10. rem ******************************************************************
  11.  
  12.  
  13. label InitDevice
  14. rem
  15. rem ******************************************************************
  16. rem ***** This section is used to initilise the Terminal Adapter.
  17. rem ******************************************************************
  18. rem
  19. echo off
  20. send    "at{InitModemStr}char(13)" 
  21. timeout 5,modem_fail
  22. find    "*** response to T.A. initialisation string ***"
  23. label OffToGate
  24. rem
  25. rem ******************************************************************
  26. rem ***** This section dials the ISDN number and sets the PAD
  27. rem ***** parameters.
  28. rem ****************************************************************** 
  29. rem
  30. rem ISDN Offline to Gate (also contains Pad to Gate)
  31. echo off
  32. echo Making call...
  33. send    "atdt{PreTel}{SiteTel}{PostFix}char(13)"
  34. timeout 15,connect_fail
  35. find    "*** T.A. response to an established ISDN connection ***"
  36. timeout 5,pad_fail
  37. find    "*** PAD prompt ***"
  38. send    "set1:1,2:0,3:2,4:1,5:1,6:5,12:1,15:0char(13)"
  39. timeout 5,pad_set_fail
  40. find    "*** PAD prompt ***"
  41. rem
  42. rem ******************************************************************
  43. rem ***** This section calls the Network User Address (NUA) and
  44. rem ***** establishes an X25 call.
  45. rem ******************************************************************
  46. rem
  47. label PadToGate
  48. echo off
  49. send    "*** Command for calling an Network User Address (if any) ***{NUA}char(13)"
  50. timeout 5,nua_fail
  51. find    "*** T.A. response to an established X25 call ***"
  52. echo Call connected.
  53. end
  54.  
  55. label GateToPad
  56. echo off
  57. rem
  58. rem ******************************************************************
  59. rem ***** This section clears the X25 call, leaving you at the PAD.
  60. rem ******************************************************************
  61. rem
  62. send    "char(16)"
  63. timeout 10,ctrl_p_fail
  64. find    "*** PAD prompt ***"
  65. mwait 500
  66. send "CLRchar(13)"
  67. timeout 10,clear_fail
  68. find "*** T.A. response to a cleared X25 call ***"
  69. echo Waiting on line...
  70. end
  71.  
  72. label GateToOff
  73. rem Gate to Offline (also contains Pad to Offline)
  74. echo off
  75. rem
  76. rem ******************************************************************
  77. rem ***** This section clears the X25 call, leaving you at the PAD.
  78. rem ******************************************************************
  79. rem
  80. send    "char(16)"
  81. timeout 10,ctrl_p_fail
  82. find    "***  PAD prompt ***"
  83. mwait 500
  84. send "CLRchar(13)"
  85. timeout 10,clear_fail
  86. find "*** T.A. response to a cleared X25 call ***"
  87. label PadToOff
  88. echo off
  89. rem
  90. rem ******************************************************************
  91. rem ***** This section clears the ISDN connection.
  92. rem ******************************************************************
  93. rem 
  94. send    "*** Command string to change T.A. from data mode to command mode ***"
  95. timeout 5,command_mode_fail
  96. find    "*** T.A. response to change from command mode to data mode ***"
  97. send    "at{TermModemStr}char(13)"
  98. timeout 5,hang_up_fail
  99. find    "*** T.A. response to termination string ***"
  100. echo Offline.
  101. end
  102.  
  103. rem
  104. rem ******************************************************************
  105. rem ***** This section provides a hard disconnection if any errors
  106. rem ***** have occured.
  107. rem ******************************************************************
  108. rem
  109. label modem_offline
  110. send "char(16)"
  111. timeout 5,clear
  112. find "*** PAD prompt ***"
  113. mwait 500
  114. label clear
  115. send    "CLRchar(13)"
  116. timeout 5,command_mode
  117. find    "*** T.A. response to a cleared X25 call ***"
  118. label command_mode
  119. send    "*** Command string to change T.A. from data mode to command mode ***"
  120. timeout 5,hang_up
  121. find    "*** T.A. response to command mode from data mode ***"
  122. label hang_up
  123. send    "at{TermModemStr}char(13)"
  124. timeout 5,hang_fail
  125. find    "*** T.A. termination string ***"
  126. label hang_fail
  127. abort
  128.  
  129.  
  130. rem
  131. rem ******************************************************************
  132. rem ***** The following sections provide some relevant error messages.
  133. rem ******************************************************************
  134. rem
  135.  
  136. label modem_fail
  137. echo script[23]
  138. abort
  139.  
  140. label connect_fail
  141. echo script[1]
  142. goto hang_up
  143.  
  144. label pad_fail
  145. echo script[4]
  146. goto command_mode
  147.  
  148. label pad_set_fail
  149. echo script[5]
  150. goto command_mode
  151.  
  152. label nua_fail
  153. echo Wrong NUA?
  154. goto command_mode
  155.  
  156. label ctrl_p_fail
  157. echo script[12]
  158. goto modem_offline
  159.  
  160. label clear_fail
  161. echo script[13]
  162. goto clear
  163.  
  164. label command_mode_fail
  165. echo script[15]
  166. goto command_mode
  167.  
  168. label hang_up_fail
  169. echo script[17]
  170. abort
  171.